/**
 * Created by Administrator on 20213/21.
 * district Model 章节信息
 */
let DbInit = require('./DbInit');
let sequelize = DbInit.sequelize;
let Sequelize=DbInit.seqobj;
let chapter = sequelize.define('chapter', {

    id: {
        type: Sequelize.INTEGER,
        autoIncrement: true,
        primaryKey: true
    },
    bookid:{
        type: Sequelize.STRING(30),
        primaryKey:true,
        allowNull:false
    },
    next:{
        type: Sequelize.STRING(5),
        primaryKey:true,
        allowNull:true
    },
    prev:{
        type: Sequelize.STRING(5),
        primaryKey:true,
        allowNull:true
    },
    name:{//章节名称
        type: Sequelize.STRING(100),
        allowNull:false
    },
    content: {//章节内容
        type: Sequelize.TEXT,
        allowNull:true
    },
    url:{//章节地址
        type: Sequelize.STRING(200),
        allowNull:true
    },
    sortid:{
        type: Sequelize.STRING(10),        
        allowNull:true
    }, 
    /* price: {//章节价格
        type: Sequelize.STRING(20),
        allowNull:true
    }, */
    status:{
        type: Sequelize.CHAR(1),
        allowNull:true
    }

}, {
    createdAt: 'creattime',
    updatedAt:'updatetime',
    charset: 'utf8',
    collate: 'utf8_general_ci',
    freezeTableName: true // Model 对应的表名将与model名相同
});



module.exports = chapter;